package thread.create;

// 创建线程
// 实现Runnable接口
public class RunnableTest implements Runnable{
    public static int count = 50;

    @Override
    public void run() {
        while (count > 0) {
            count--;
            System.out.println("当前数量 "+ count + " " + Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) {
        Thread t1 = new Thread(new RunnableTest());
        t1.setName("t1");
        t1.start();

        Thread t2 = new Thread(new RunnableTest());
        t2.setName("t2");
        t2.start();
    }
}
